using UnityEngine;
using System.Collections;
using System.Collections.Generic;


public class HUDElement : Element {

    protected List<HUDButton> _listButtons = new List<HUDButton>();
    protected HUD hud;

    public HUD Hud
    {
        get { return hud; }
        set { hud = value; }
    }

	// Use this for initialization
	void Start () {

	}


    protected void AddButton(HUDButton button)
    {
        button.MouseClick += new OnMouseEvent(OnClick);
        button.MouseOverEvent += new OnMouseEvent(OnOver);
        button.MouseRelease += new OnMouseEvent(OnRelease);

        _listButtons.Add(button);
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    

    public virtual void OnClick(object o)
    {
    }

    public virtual void OnRelease(object o)
    {
    }

    public virtual void OnOver(object o)
    {
    }

    //Unload Buttons Events
    public void UnloadEvents()
    {
        foreach (HUDButton button in _listButtons)
        {
            button.MouseClick -= new OnMouseEvent(OnClick);
            button.MouseOverEvent -= new OnMouseEvent(OnOver);
            button.MouseRelease -= new OnMouseEvent(OnRelease);
        }
    }
}
